<template>
  <div>
    <Header />
    <el-row type="flex" justify="center">
      <el-col :span="18">
        <el-table border="true" :data="blogView" style="width: 100%"   >
          <el-table-column sortable prop="title" label="标题">
          </el-table-column>
          <el-table-column sortable prop="read" label="阅读量">
          </el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button
                type="primary"
                size="small"
                @click="editBlog(scope.row)"
                >编辑</el-button
              >
              <el-button
                type="danger"
                size="small"
                @click="deleteBlog(scope.row)"
                >删除</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Header from "@/components/Header.vue";
export default {
  data() {
    return {
      blogView: [
        {
          title: "这是李念达的假数据",
          read: "1"
        },
        {
          title: "这女朋友的假数据",
          read: "1万+"
        }
      ]
    };
  },
  methods:{
      editBlog(row){
            this.$router.push({
                name:"WriteBlog",
                params:{    }
            })
      }
  },
  components: {
    Header
  }
};
</script>
